package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单类型
 * @author zach
 * @Date :2020-09-24 12:14.
 */
@AllArgsConstructor
@Getter
public enum OrderTypeEnum {
    shopping( "0", "购物消费"),
    moreCredit( "1", "话费充值"),
    assistFund( "2", "帮扶基金"),
    JOIN_AGENT("3","加盟代理"),
    ;
    private String code;
    private String name;


    public static String getOrderNameByCode(String code){
        for(OrderTypeEnum orderTypeEnum :OrderTypeEnum.values()){
            if(orderTypeEnum.getCode().equals(code)){
                return orderTypeEnum.getName();
            }
        }
        return OrderTypeEnum.shopping.getName();
    }
}
